package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.net.domain.BusiMplstpRouteTableListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiMplstpRouteTableMapper;
import com.ruoyi.net.domain.BusiMplstpRouteTable;
import com.ruoyi.net.service.IBusiMplstpRouteTableService;

/**
 * 业务-mplstp路由Service业务层处理
 * 
 * @author net
 * @date 2024-12-25
 */
@Service
public class BusiMplstpRouteTableServiceImpl implements IBusiMplstpRouteTableService 
{
    @Autowired
    private BusiMplstpRouteTableMapper busiMplstpRouteTableMapper;

    /**
     * 查询业务-mplstp路由
     * 
     * @param id 业务-mplstp路由主键
     * @return 业务-mplstp路由
     */
    @Override
    public BusiMplstpRouteTable selectBusiMplstpRouteTableById(String id)
    {
        return busiMplstpRouteTableMapper.selectBusiMplstpRouteTableById(id);
    }

    /**
     * 查询业务-mplstp路由列表
     * 
     * @param busiMplstpRouteTable 业务-mplstp路由
     * @return 业务-mplstp路由
     */
    @Override
    public List<BusiMplstpRouteTableListVo> selectBusiMplstpRouteTableList(BusiMplstpRouteTable busiMplstpRouteTable)
    {
        return busiMplstpRouteTableMapper.selectBusiMplstpRouteTableList(busiMplstpRouteTable);
    }

    /**
     * 新增业务-mplstp路由
     * 
     * @param busiMplstpRouteTable 业务-mplstp路由
     * @return 结果
     */
    @Override
    public int insertBusiMplstpRouteTable(BusiMplstpRouteTable busiMplstpRouteTable)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiMplstpRouteTable.getId())) {
            busiMplstpRouteTable.setId(uuid);
        }
        busiMplstpRouteTable.setCreateBy(SecurityUtils.getUsername());
        busiMplstpRouteTable.setCreateTime(DateUtils.getNowDate());
        busiMplstpRouteTable.setUpdateBy(SecurityUtils.getUsername());
        busiMplstpRouteTable.setUpdateTime(DateUtils.getNowDate());
        return busiMplstpRouteTableMapper.insertBusiMplstpRouteTable(busiMplstpRouteTable);
    }

    /**
     * 修改业务-mplstp路由
     * 
     * @param busiMplstpRouteTable 业务-mplstp路由
     * @return 结果
     */
    @Override
    public int updateBusiMplstpRouteTable(BusiMplstpRouteTable busiMplstpRouteTable)
    {
        busiMplstpRouteTable.setUpdateBy(SecurityUtils.getUsername());
        busiMplstpRouteTable.setUpdateTime(DateUtils.getNowDate());
        return busiMplstpRouteTableMapper.updateBusiMplstpRouteTable(busiMplstpRouteTable);
    }

    /**
     * 批量删除业务-mplstp路由
     * 
     * @param ids 需要删除的业务-mplstp路由主键
     * @return 结果
     */
    @Override
    public int deleteBusiMplstpRouteTableByIds(String[] ids)
    {
        return busiMplstpRouteTableMapper.deleteBusiMplstpRouteTableByIds(ids);
    }

    /**
     * 删除业务-mplstp路由信息
     * 
     * @param id 业务-mplstp路由主键
     * @return 结果
     */
    @Override
    public int deleteBusiMplstpRouteTableById(String id)
    {
        return busiMplstpRouteTableMapper.deleteBusiMplstpRouteTableById(id);
    }
}
